import Person from './person';
class Teacher extends Person
{
    constructor(id,name,age,classT){
        super(id,name,age);
        this.classT = classT;
    }
    outputKlasses(){
        let str = '';
        for(let item of this.classT)
        {
            str += ` ${item.number},`;
        }
        str = str.slice(0, -1);
        return super.introduce() + ` I am a Teacher. I teach Class${str}.`;
    }
    introduce(){
        if(!this.classT)
        {
            return super.introduce() + ` I am a Teacher. I teach No Class.`;
        }
        else
        {
            return this.outputKlasses();
        }
    }
}
module.exports = Teacher;